home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / n2ctclib10.lha / n2c / Source / TCL_Startup.a < prev   
Text File  |  1997-01-30  |  2KB  |  85 lines

  1.     include 'tclib.i'
  2.  
  3.     section text,code
  4.  
  5.     xref     _CTCL_n2c
  6.  
  7. startall:
  8.     moveq   #-13,d0     ; if user tries to start this lib!
  9.     rts                 ;   (need -13 to identify TClibs!)
  10.     dc.l 'TCLB'         ; TurboCalc-Lib - this field is used to identify
  11.                         ;   TClibs and to link them in memory (i.e. that
  12.                         ;   this entry is used and thus changed by TC
  13.                         ;   to keep a list of all already loaded libs!)
  14.     dc.l 'FNCT'
  15.     dc.w 1,0            ; Version, Revision
  16.     dc.l TCL_Name        ; Little description
  17.     dc.l TCL_Ver        ; Standard Amiga version string
  18.     dc.l TCL_Author        ; ....
  19.     dc.l 0              ; flags - reserved
  20.     dc.l 0              ; reserved
  21.     dc.l 0              ; reserved
  22. ; default-routines
  23.     dc.l 0  ; init
  24.     dc.l 0  ; exit
  25.     dc.l 0  ; flush
  26.     dc.l 0
  27. ;
  28.     dc.l 0  ; flags
  29.     dc.l 2                ; number of functions
  30.     dc.l TCL_fncdefault
  31.     dc.l TCL_n2c
  32.     dc.l TCL_n2cp
  33.  
  34.     TCL_Name: dc.b 'Converts a number from digits to characters',0
  35.     TCL_Ver: dc.b '$VER: n2c 1.0 (28.1.97)',0
  36.     TCL_Author: dc.b '© 1997 Alessandro Zummo',0
  37.  
  38.      cnop 0,2
  39.  
  40.  
  41. *** unknown function - simply return function-number as init!
  42. TCL_fncdefault:
  43.     move.l  d7,d0
  44.     moveq   #TYPE_NUM,d2
  45.     rts
  46.  
  47. TCL_n2c:
  48.     movem.l    D3-D7/A2-A6,-(A7)    ;Preserve registers
  49.  
  50.     move.l  #200,d0                ;Allocate memory for string buffer
  51.     XSR        AllocTEXTMem
  52.  
  53.     move.l    a0,a2                
  54.     move.l    #0,d3                ;Option: normal
  55.  
  56.     jsr        _CTCL_n2c            ;Call n2c
  57.  
  58.     move.l  a2,d0                ;Save result
  59.  
  60.     moveq   #TYPE_TEXT,d2        ;Set result type
  61.  
  62.     movem.l    (A7)+,D3-D7/A2-A6    ;Reload registers
  63.     rts
  64.     
  65.  
  66. TCL_n2cp:
  67.     movem.l    D3-D7/A2-A6,-(A7)    ;Preserve registers
  68.  
  69.     move.l  #200,d0                ;Allocate memory for string buffer
  70.     XSR        AllocTEXTMem
  71.  
  72.     move.l    a0,a2                
  73.     move.l    #1,d3                ;Option: short form
  74.  
  75.     jsr        _CTCL_n2c            ;Call n2c
  76.  
  77.     move.l  a2,d0                ;Save result
  78.  
  79.     moveq   #TYPE_TEXT,d2        ;Set result type
  80.  
  81.     movem.l    (A7)+,D3-D7/A2-A6    ;Reload registers
  82.     rts
  83.  
  84.     end
  85.